using System;
using System.Collections.Generic;
using System.Text;

namespace Hoshimi
{
	public class ComplexCollectorGroup_ManageState : State
	{
		#region Singleton

		// Fields
		protected static ComplexCollectorGroup_ManageState instance;

		// Constructor
		protected ComplexCollectorGroup_ManageState() : base() { }

		// Methods
		public static ComplexCollectorGroup_ManageState Instance()
		{
			// Uses "Lazy initialization"
			if( instance == null ) 
				instance = new ComplexCollectorGroup_ManageState();

			return instance;
		}

		#endregion

		public override bool Play( Unit unit )
		{
			ComplexCollectorGroup myGroup = (ComplexCollectorGroup) unit;

			if ( myGroup.IsGroupCollectEmpty() )
			{
				// Needle full or dead
				myGroup.myStateMachine.ChangeState( ComplexCollectorGroup_ReleaseState.Instance() );
				return false;
			}

			return true;
		}
	}
}
